const merge = require('webpack-merge');
const path = require('path');
const baseWebpackConfig = require('./index.js');
// 清空dist目录
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// 压缩css文件
const OptimizeCssPlugin = require('optimize-css-assets-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const smp = new SpeedMeasurePlugin();

module.exports = smp.wrap(merge(baseWebpackConfig, {
	mode: 'production',
	output: {
		path: path.resolve(__dirname, '../dist'),
		publicPath: './'
	},
	module: {
		
	},
	plugins: [
		new CleanWebpackPlugin(),
		new OptimizeCssPlugin(),
		new CopyWebpackPlugin()
	],
	devtool: 'source-map'
}))